package com.dt.app.api.shopping.service.impl;

import com.dt.app.modules.shopping.entities.DsPromotion;
import com.dt.app.modules.shopping.vo.DsPromotionBean;
import com.dt.app.api.shopping.mapper.DsPromotionMapper;
import com.dt.app.api.shopping.service.IDsPromotionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 鸿源塔基
 * @since 2023-02-25
 */
@Service
public class DsPromotionServiceImpl extends ServiceImpl<DsPromotionMapper, DsPromotion> implements IDsPromotionService {
    public DsPromotion getEntity(DsPromotionBean bean){
        DsPromotion entity = new DsPromotion();
        entity.setDsPromotionId(bean.getDsPromotionId());
        entity.setPromotionTypeId(bean.getPromotionTypeId());
        entity.setSellerHeadquartersId(bean.getSellerHeadquartersId());
        entity.setPromotionTitle(bean.getPromotionTitle());
        entity.setPromotionDescription(bean.getPromotionDescription());
        entity.setImgUrl(bean.getImgUrl());
        entity.setPcImgUrl(bean.getPcImgUrl());
        entity.setIsTimeLimit(bean.getIsTimeLimit());
        entity.setMembershipLevel(bean.getMembershipLevel());
        entity.setPromotionType(bean.getPromotionType());
        entity.setDiscountType(bean.getDiscountType());
        entity.setMinProductQty(bean.getMinProductQty());
        entity.setOrderSubtotalAmt(bean.getOrderSubtotalAmt());
        entity.setPointsPerAmt(bean.getPointsPerAmt());
        entity.setDiscount(bean.getDiscount());
        entity.setMaxCount(bean.getMaxCount());
        entity.setUseCount(bean.getUseCount());
        entity.setStatus(bean.getStatus());
        entity.setPriority(bean.getPriority());
        entity.setIsApplyToAll(bean.getIsApplyToAll());
        entity.setDblDiscount(bean.getDblDiscount());
        entity.setTemplatePath(bean.getTemplatePath());
        entity.setCreateTime(bean.getCreateTime());
        entity.setCreateId(bean.getCreateId());
        entity.setSellersId(bean.getSellersId());
        entity.setSellerName(bean.getSellerName());
        entity.setCategoryPath(bean.getCategoryPath());
        entity.setRegionPath(bean.getRegionPath());
        entity.setDeleted(bean.getDeleted());
        entity.setRegionId(bean.getRegionId());
        entity.setLongitude(bean.getLongitude());
        entity.setLatitude(bean.getLatitude());
        entity.setSeq(bean.getSeq());
        return entity;
    }
    public DsPromotionBean getBean(DsPromotion entity){
        DsPromotionBean bean = new DsPromotionBean();
        bean.setDsPromotionId(entity.getDsPromotionId());
        bean.setPromotionTypeId(entity.getPromotionTypeId());
        bean.setSellerHeadquartersId(entity.getSellerHeadquartersId());
        bean.setPromotionTitle(entity.getPromotionTitle());
        bean.setPromotionDescription(entity.getPromotionDescription());
        bean.setImgUrl(entity.getImgUrl());
        bean.setPcImgUrl(entity.getPcImgUrl());
        bean.setIsTimeLimit(entity.getIsTimeLimit());
        bean.setMembershipLevel(entity.getMembershipLevel());
        bean.setPromotionType(entity.getPromotionType());
        bean.setDiscountType(entity.getDiscountType());
        bean.setMinProductQty(entity.getMinProductQty());
        bean.setOrderSubtotalAmt(entity.getOrderSubtotalAmt());
        bean.setPointsPerAmt(entity.getPointsPerAmt());
        bean.setDiscount(entity.getDiscount());
        bean.setMaxCount(entity.getMaxCount());
        bean.setUseCount(entity.getUseCount());
        bean.setStatus(entity.getStatus());
        bean.setPriority(entity.getPriority());
        bean.setIsApplyToAll(entity.getIsApplyToAll());
        bean.setDblDiscount(entity.getDblDiscount());
        bean.setTemplatePath(entity.getTemplatePath());
        bean.setCreateTime(entity.getCreateTime());
        bean.setCreateId(entity.getCreateId());
        bean.setSellersId(entity.getSellersId());
        bean.setSellerName(entity.getSellerName());
        bean.setCategoryPath(entity.getCategoryPath());
        bean.setRegionPath(entity.getRegionPath());
        bean.setDeleted(entity.getDeleted());
        bean.setRegionId(entity.getRegionId());
        bean.setLongitude(entity.getLongitude());
        bean.setLatitude(entity.getLatitude());
        bean.setSeq(entity.getSeq());
        return bean;
    }
}
